feat(core): Deprecate beforeSendTransaction and ignoreTransactions and log warnings if used with streaming - #22908
Merged
Merged
Conversation
Both options operate on the transaction event that span streaming no longer produces, so they silently stopped taking effect when span streaming became the default. That is easy to miss when upgrading. Deprecate both options with a note that they only apply in combination with `traceLifecycle: 'static'` and will be removed in v12, and warn at init time when either is set while span streaming is enabled. The warning writes to the console directly rather than through `debug`, which is opt-in and stripped from non-debug bundles, so users who need to see it actually do. The check runs after integration setup because `spanStreamingIntegration` can fall back to the static trace lifecycle, in which case both options do apply and we must stay silent. Fixes #22856 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 21fd1c9. Configure here.
beforeSendTransaction and ignoreTransactionsbeforeSendTransaction and ignoreTransactions and log warnings if used with streaming
The warning ships in every bundle, including the base CDN bundle that has no tracing at all, so its message text is paid for by users who will never see it. Measured against a build with the feature stubbed out, the original cost 204 B gzipped in the base CDN bundle. Almost all of that was the message: dropping the array/filter/join in favour of a single static string, and giving up naming which of the two options is actually set, brings it to 87 B — a 117 B saving. Naming the specific option was the expensive part, not the machinery that selected it; an interpolation-free ternary variant measured worse than the array it would have replaced. The static message still names both options, both replacements, and the opt-out, so it loses no actionable information. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Lms24
marked this pull request as ready for review
July 31, 2026 11:49
A disabled client (no DSN, or `enabled: false`) skips `_setupIntegrations()`, so `spanStreamingIntegration` never gets the chance to fall back to `traceLifecycle: 'static'`. The lifecycle stayed 'stream' and the warning fired, telling users their options were ignored because of span streaming — when the real reason was that the client sends nothing at all. The two paths were verifiably indistinguishable to the user: with an unwrapped `beforeSendSpan`, the identical config warns without a DSN and stays correctly silent with one, purely because setup ran in the second case. Move the call inside the branch that sets integrations up. The Spotlight escape hatch is handled correctly by construction: a DSN-less client with Spotlight does set up integrations and does send spans, so it should still warn. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
andreiborza
approved these changes
Jul 31, 2026
| consoleSandbox(() => { | ||
| // oxlint-disable-next-line no-console | ||
| console.warn( | ||
| "[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with span streaming. Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.", |
Member
There was a problem hiding this comment.
l: Could we replace span streaming with traceLifecycle: 'stream' so it's even more obvious why this happens?
Lms24
enabled auto-merge (squash)
July 31, 2026 14:08
andreiborza
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR:
beforeSendTransactionandignoreTransactionsdebug: true) to warn users if they use any of the two options with span streaming enabledI intentionally didn't update the migration guide. this is handled in #22643.
more details in #22856
closes #22856
closes #20279